Runnymede. 1215. King John. Held at sword-point by noble lords, barons, earls, and knights. Give us justice or give us death, they say, in anticipation of Patrick Henry. Or maybe he was copying them. Take not our lives or our land except by the law of the land. This translates to our "due process of law."
America is big on due process of law, except for people we don't like or who we think don't deserve it, such as people we regard as enemies. Ants in hives aren't big on due process either, but we're supposed to be different than ants.
Habeas corpus means "You, Mr. Sheriff, or Mr. Anybody, have the body of this person, and we want him here in this court so you can explain why you are holding him, and it had better be for a legal reason, or we'll order you to release him, and if you don't, we'll jail you for contempt."
Mr. Sheriff, the king's agent, must then appear with the body, the prisoner, and explain why he's holding you, let's say. This is your only ticket out of the dungeon, jail, mental hospital, brig, or prison camp such as in Guantanamo, Cuba, where we have this base in which we treat people not very nicely.
But suppose the people who run the military prison at Guantanamo get Congress to pass a law requiring the courts to dismiss all habeas petitions filed on behalf of the prisoners. We would never do that here in America, would we?
Buzz! Wrong!!! You got it wrong. You thought America was good, didn't you? So did I. I hate to be disillusioned, don't you?
Read all about how we are our own worst enemy whenever we get scared enough to jettison our hard earned protections, in Jeffrey Toobin's New Yorker article, below. We have met the enemy and he his us. So said Walt Kelly's Pogo.